There is a known problem with Metrowerks CodeWarrior (CW8, v1.4.3) that results in incorrectly built 68K parts. The parts will compile and link, but will have errors at runtime. The problem is that CodeWarrior currently does not honor the CFM68K calling conventions for returning 4-byte structs as a function result. For example:
struct Point
{
short x;
short y;
};
Point GetPoint()
{
Point result = {0,0};
return result;
}
CFM68K calling conventions call for structs whose size is 4 bytes or less to be returned in register D0. Structs of larger size are returned on the stack. CodeWarrior currently returns all structs on the stack.
ODFLibrary defines several functions that return 4-byte structs as function results. As it happens, none of these functions are needed to get a basic part up and running, so all of the ODF parts will launch. However, most interesting parts will have a need for at least one of these functions. For example, the ODFDraw drawing tools all depend on these functions. ODFClock, on the other hand, does not require any of these functions and works fine.
There is another known problem that has an easy workaround. The problem is with " #pragma import on/reset". Specifically, "#pragma import reset" does not always correctly reset the import state. This bug shows up as link errors against the SOM kernal functions. If you run into this problem and wish to work around it, look at the link errors. You should see "Unresolved reference to somSomething in file xxxxxx.cpp" (where "somSomething "is the unresolved function). Open up the .cpp file and add a line like this after all of your #includes and before the first function:
#pragma import list somSomething
If more than one function is unresolved, you can list them separated by commas:
#pragma import list somSomething, somSomethingElse
Metrowerks is aware of these problems and plans to provide a netbourne fix.
NOTE: At the time of writing this document, CodeWarrior 9 is already final and will NOT have the necessary fix. The netbourne fix will be an update to CW9.